import { S } from '../../s';
import { IPSAppPortlet } from './ipsapp-portlet';
import { IPSAppPortletCat } from './ipsapp-portlet-cat';
import { IPSAppDataEntity } from '../dataentity/ipsapp-data-entity';
import { IPSControl } from '../../control/ipscontrol';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSAppPortletImpl
  extends PSModelObjectImpl
  implements IPSAppPortlet
{
  get codeName(): string {
    return this.M.codeName;
  }

  protected psappdataentity: IPSAppDataEntity;
  getPSAppDataEntity(): IPSAppDataEntity | null {
    return (
      this.psappdataentity ||
      (this.psappdataentity = this.fillObjectModel(
        S._f,
        this.M.getPSAppDataEntity,
        S._2aa,
      ) as IPSAppDataEntity)
    );
  }

  protected psappportletcat: IPSAppPortletCat;
  getPSAppPortletCat(): IPSAppPortletCat | null {
    return (
      this.psappportletcat ||
      (this.psappportletcat = this.fillObjectModel(
        S._c,
        this.M.getPSAppPortletCat,
        S._2be,
      ) as IPSAppPortletCat)
    );
  }

  protected pscontrol: IPSControl;
  getPSControl(): IPSControl | null {
    return (
      this.pscontrol ||
      (this.pscontrol = this.fillObjectModel(
        S._214,
        this.M.getPSControl,
        S._2bf,
      ) as IPSControl)
    );
  }

  get enableAppDashboard(): boolean {
    return this.M.enableAppDashboard;
  }

  get enableDEDashboard(): boolean {
    return this.M.enableDEDashboard;
  }
  get cls(): string {
    return 'PSAppPortletImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._d) return true;
    return super.instanceof(cls);
  }
}
